Skip to content

Add agent readiness section - #1926

Closed
nate-double-u wants to merge 3 commits into
cncf:mainfrom
nate-double-u:agent-readiness-check
Closed

nate-double-u wants to merge 3 commits into
cncf:mainfrom
nate-double-u:agent-readiness-check

Conversation

@nate-double-u

@nate-double-u nate-double-u commented Aug 27, 2026 •

Copy link
Copy Markdown
Member

Adds an Agent readiness report section that evaluates how well AI coding agents can discover and consume a project's documentation.

Per review feedback, this wraps AFDocs, the reference implementation of the Agent-Friendly Documentation Spec, the same way CLOMonitor wraps OpenSSF Scorecard for security checks. The earlier native llms.txt check is gone. Inspired by linuxfoundation/insights#1830.

Open questions

  1. Weight: 1 per check → section is ~7% of the global score (denominator 96 → 103). Is this appropriate?
  2. Pass semantics: a category fails only on FAIL. WARN, ERROR and unknown statuses are tolerated, and all-SKIP → exempt. E.g. prometheus.io observability (skip, skip, warn) currently passes. Stricter option: treat ERROR/unknown as fail.
  3. Version cadence: afdocs pinned at 0.20.0 in the Dockerfiles, like Scorecard. Is there a bump policy for clomonitor?

How it works

  • afdocs check <website> --format json runs against the website configured in the GitHub repository, concurrently with Scorecard (afdocs doesn't use the GitHub token).
  • One CLOMonitor check per AFDocs category (7): authentication, content discoverability, content structure, markdown availability, observability, page size, URL stability. Check sets community + docs.
  • A check passes when no AFDocs check in its category fails (warnings tolerated). If AFDocs skips a whole category, the check is marked exempt.
  • The check details dropdown (existing UI, as used by Scorecard checks) shows per-check statuses and messages, linking to the spec.
  • afdocs only runs when it's needed: no website configured, or a check set with none of these checks (e.g. code-only repos) → no crawl, and the section is not applicable and hidden everywhere (score, UI, reports, stats).

Breaking changes

  • The linter now requires the afdocs binary in PATH when the selected check sets include any agent readiness check (community/docs). The official linter container image includes it; CI users running the raw binary with those check sets will need to npm install -g afdocs.
  • The apiserver CSV export (/data/repositories.csv) gains 7 new check columns.

Testing

cargo test 234 ✓ · web 200 ✓ · pgTAP 50 ✓ · fmt/clippy/prettier/eslint clean

Screenshots

v3-01-home

v3-02-hyperwave-all-pass

v3-03-nimbus-exempt-fail

v3-04-prometheus-details-hover

v3-05-stats

v3-06-docs-agent-readiness

@nate-double-u

Copy link
Copy Markdown
Member Author

/cc @caniszczyk

@nate-double-u
nate-double-u marked this pull request as ready for review August 27, 2026 17:08
@riaankleinhans
riaankleinhans requested review from riaankleinhans and tegioz and a lite review from Copilot August 27, 2026 17:38
@riaankleinhans

Copy link
Copy Markdown
Contributor

Great addition @nate-double-u

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Documentation / Agent readiness check to CLOMonitor, validating that projects publish an llms.txt or llms-full.txt index either on the project website root (rejecting HTML/SPA fallback) or in the repo (/ or docs/). This integrates the new check across the core linter, scoring, API output, database stats/exports, web UI, and docs.

Changes:

  • Introduces a new core linter check (agent_readiness) with website + repository probing logic and tests.
  • Wires the new check through scoring weights, report structs/templates, database stats and CSV export, and UI option metadata.
  • Documents the new check and updates golden outputs/tests.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
web/src/types.ts Adds AgentReadiness report option ID.
web/src/data.tsx Adds UI metadata (icon/label/legend/link) and categorization for the new check.
docs/checks.md Documents the new check behavior, IDs, and probing rules.
database/tests/functions/stats/get_stats.sql Updates stats test fixtures to include agent_readiness.
database/tests/functions/repositories/get_repositories_with_checks.sql Updates CSV export test fixture to include the new column.
database/migrations/functions/stats/get_stats.sql Adds agent_readiness to passing-check stats output.
database/migrations/functions/repositories/get_repositories_with_checks.sql Adds agent_readiness column to repositories-with-checks CSV function.
clomonitor-linter/src/testdata/display.golden Updates expected CLI table output to include the new row.
clomonitor-linter/src/table.rs Adds Documentation / Agent readiness row in CLI display and updates tests.
clomonitor-core/src/testdata/agent-readiness/llms.txt Adds testdata file used for repo-based detection tests.
clomonitor-core/src/score/mod.rs Updates scoring tests/weights to account for the new documentation check.
clomonitor-core/src/linter/report.rs Extends Documentation report section with agent_readiness.
clomonitor-core/src/linter/mod.rs Runs the new async check and populates it into the report.
clomonitor-core/src/linter/checks/mod.rs Registers the new check module/config.
clomonitor-core/src/linter/checks/agent_readiness.rs Implements the new check + tests (website fetch + repo glob search).
clomonitor-apiserver/templates/repository-report.md Adds the new check to rendered repository report markdown.
clomonitor-apiserver/src/testdata/repository-report.golden.md Updates golden markdown output to include the new check.
clomonitor-apiserver/src/router.rs Updates API router tests’ report fixtures to include agent_readiness.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/checks.md Resolved
Comment thread web/src/data.tsx Resolved
Comment thread clomonitor-core/src/score/mod.rs Resolved
@caniszczyk

Copy link
Copy Markdown

So this is a great start, what about actually just running https://afdocs.dev and create a new top level section under documentation (or above) called "Agent Readiness" and basically puts this in a friendly fashion:

npx afdocs check https://docs.example.com --format scorecard

@nate-double-u

nate-double-u commented Aug 27, 2026 •

Copy link
Copy Markdown
Member Author

That was going to be next, I can do it up as a part of this PR.

@caniszczyk

Copy link
Copy Markdown

@nate-double-u let's start simple here and wait for @tegioz to review

@nate-double-u

Copy link
Copy Markdown
Member Author

Sounds good, I'll hold off till we hear from Sergio.

@tegioz

tegioz commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Thanks @nate-double-u.

There are some fixes and improvements we'd like to apply to this PR (we'll take care of them ourselves if we continue with this approach).

Based on the issues linked, I'm not sure if this is really the best approach for this check. As it is, the check is a bit shallow, checking only for the existence of the llms.txt file (1 check out of the 23 defined in https://agentdocsspec.com).

Another way of doing this would be to rely on the afdocs tool, as @caniszczyk suggested. That'd work similarly to what we do with scorecard. If we rely on afdocs, we wouldn't need this PR, as afdocs covers all checks in the spec. It wouldn't be a follow up, and the approaches shouldn't be mixed.

The alternative to relying on afdocs would be to keep building on top of this PR and implement all checks needed. But at some point we'd essentially be creating another implementation of afdocs that we'd need to maintain as the spec evolves.

IMHO, I'd go with afdocs. We'll take care of this if you'd like to go ahead with this approach.

Before sending a PR, it'd be great if we could discuss options first. Reviewing PRs takes time, sometimes a lot if they're large 😅. Often, the best way to help is to provide details about what you'd like to do or have, and point out possible solutions like the spec and tool mentioned above. That saves us time and helps a lot.

Once we have that information, it's usually easier for us to steer agents ourselves from the beginning, at plan time. Going back and forth with feedback that then needs to be passed on to your agent makes the process slower: we need to review the changes repeatedly, and agents sometimes rewrite large parts of a PR in response to feedback. It also means switching context back to the same task multiple times, often across different days.

We really appreciate contributors wanting to help, and the biggest help is often making it easier for maintainers to focus their time where it can have the most impact 🙂

@nate-double-u
nate-double-u marked this pull request as draft September 7, 2026 00:43
Assisted-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Nate W <natew@cncf.io>
Assisted-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Nate W <natew@cncf.io>
Replace the native llms.txt check with an Agent readiness report
section wrapping afdocs (https://afdocs.dev), one check per spec
category, mirroring how OpenSSF Scorecard checks are integrated.
The section only applies to repositories with a website configured.

Assisted-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Nate W <natew@cncf.io>
@nate-double-u

Copy link
Copy Markdown
Member Author

Thanks @tegioz. I agree about afdocs; I always intended to wrap it, and probably should have left this PR as a draft. I've reworked it to match what you described: the native llms.txt check is gone, and afdocs is wrapped the way scorecard is, with a pinned binary in the tracker/linter images, one run per repository against its configured website, and a new top-level Agent readiness section with seven checks, one per spec category: content discoverability, markdown availability, content structure, page size, URL stability, observability, and authentication. I didn't add any new UI; the new check details reuse the existing hover dropdown.

@nate-double-u nate-double-u changed the title Add agent readiness check Add agent readiness section Sep 7, 2026
@nate-double-u

nate-double-u commented Sep 7, 2026 •

Copy link
Copy Markdown
Member Author

New screenshots:

v3-01-home

v3-02-hyperwave-all-pass

v3-03-nimbus-exempt-fail

v3-04-prometheus-details-hover

v3-05-stats

v3-06-docs-agent-readiness

@nate-double-u
nate-double-u marked this pull request as ready for review September 7, 2026 05:37
@nate-double-u
nate-double-u requested a balanced review from Copilot September 7, 2026 05:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unvalidated crawling introduces SSRF risk, while several surfaces mishandle inapplicable categories and AFDocs error semantics.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 51/51 changed files
  • Comments generated: 8
  • Review effort level: Balanced

Comment on lines +56 to +60
let output = Command::new("afdocs")
.arg("check")
.arg(website_url)
.arg("--format")
.arg("json")
| Category | Score |
| :-------------- | -----------------------------------------------: |
| Documentation | {{ category_score(score.documentation) }} |
| Agent Readiness | {{ category_score(score.agent_readiness) }} |
Comment on lines +306 to +309
let all_skipped = results.iter().all(|r| r.status == AfdocsCheckStatus::Skip);
let some_failed = results.iter().any(|r| {
matches!(r.status, AfdocsCheckStatus::Fail | AfdocsCheckStatus::Error)
});
Comment on lines +58 to +61
.add_row(vec![
cell_entry("Agent readiness"),
cell_score(score.agent_readiness),
])
Comment on lines +168 to +169
'agent_readiness', json_build_object(
'authentication', repositories_passing_check(p_foundation, 'agent_readiness', 'authentication'),
Comment on lines +58 to +65
<CategoryProgressbar
name="Agent Readiness"
value={props.score.agent_readiness}
icon={CATEGORY_ICONS[ScoreType.AgentReadiness]}
bigSize={props.bigSize}
linkTo={activeLink ? `${props.repoName}_${ScoreType.AgentReadiness}` : undefined}
scrollIntoView={activeLink ? props.scrollIntoView : undefined}
/>
Comment on lines +53 to +56
<th scope="col" className="d-none d-md-table-cell text-center text-nowrap">
<small className={`position-relative ${styles.icon}`}>{CATEGORY_ICONS[ScoreType.AgentReadiness]}</small>
<span className="d-none d-xl-inline-block ms-1 ms-xl-2">Agent Readiness</span>
</th>
icon={CATEGORY_ICONS[ScoreType.Documentation]}
value={props.data.documentation}
/>
{!isUndefined(props.data.agent_readiness) && (
@tegioz

tegioz commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Thanks @nate-double-u. As I mentioned in my last comment, we'd rather take care of this ourselves.

@caniszczyk

Copy link
Copy Markdown

This is definitely more in line with what I was looking for @nate-double-u, thank you for getting this work started.

@tegioz if we can find a way to add this functionality it would be great

@tegioz

tegioz commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Sure, we'll take care of it 👍

@tegioz

tegioz commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Agent readiness section ready, we'll deploy it next week.

Closing this PR in favor of #1931

@tegioz tegioz closed this Sep 18, 2026
@tegioz

tegioz commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Deployed! (Cilium sample results)

The new checks are part of the community check set. By default, we use the homepage url set up in the GitHub repository. In some cases, that url may point to a general website instead of the documentation. When that happens, projects can override the url we check from the .clomonitor.yml file. It'd be great if they were aware of this so that the results are more accurate and useful (it's explained in the docs and UI as well).

The checks are only advisory for now, so they don't affect global scores yet. This way we can test everything properly and give projects a bit of time to catch up.

# Agent readiness information
agentReadiness:
# URL of the documentation site to analyze with AFDocs
#
# CLOMonitor uses the repository's GitHub homepage URL by default. If the
# documentation that agents should read is hosted elsewhere, this url can be
# set to run the agent readiness checks against that location.
url: https://docs.example.org/

@nate-double-u

Copy link
Copy Markdown
Member Author

Deployed! (Cilium sample results)

The new checks are part of the community check set. By default, we use the homepage url set up in the GitHub repository. In some cases, that url may point to a general website instead of the documentation. When that happens, projects can override the url we check from the .clomonitor.yml file. It'd be great if they were aware of this so that the results are more accurate and useful (it's explained in the docs and UI as well).

The checks are only advisory for now, so they don't affect global scores yet. This way we can test everything properly and give projects a bit of time to catch up.

Thanks @tegioz!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants